package com.example.ibsp_demo.pojo.entity.message;

import java.time.LocalDateTime;

/**
 * 私信消息实体类
 * 对应数据库表 private_message
 */
public class PrivateMessage {
    private int pmId;     // 消息ID

    public int getPmId() {
        return pmId;
    }

    public void setPmId(int pmId) {
        this.pmId = pmId;
    }

    private int sessionId;     // 会话ID
    private int senderId;      // 发送者ID
    private int receiverId;    // 接收者ID
    private String content;    // 消息内容
    private LocalDateTime sendTime; // 发送时间
    private int isRead;    // 阅读状态

    public int getIsRead() {
        return isRead;
    }

    public void setIsRead(int isRead) {
        this.isRead = isRead;
    }

    public PrivateMessage() {
    }

    public PrivateMessage(int messageId, int sessionId, int senderId, int receiverId,
                          String content, LocalDateTime sendTime, boolean isRead) {
        this.pmId = messageId;
        this.sessionId = sessionId;
        this.senderId = senderId;
        this.receiverId = receiverId;
        this.content = content;
        this.sendTime = sendTime;

    }

    // Getters and Setters
    public int getMessageId() {
        return pmId;
    }

    public void setMessageId(int messageId) {
        this.pmId = messageId;
    }

    public int getSessionId() {
        return sessionId;
    }

    public void setSessionId(int sessionId) {
        this.sessionId = sessionId;
    }

    public int getSenderId() {
        return senderId;
    }

    public void setSenderId(int senderId) {
        this.senderId = senderId;
    }

    public int getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(int receiverId) {
        this.receiverId = receiverId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getSendTime() {
        return sendTime;
    }

    public void setSendTime(LocalDateTime sendTime) {
        this.sendTime = sendTime;
    }



    @Override
    public String toString() {
        return "PrivateMessage{" +
                "messageId=" + pmId +
                ", sessionId=" + sessionId +
                ", senderId=" + senderId +
                ", receiverId=" + receiverId +
                ", content='" + content + '\'' +
                ", sendTime=" + sendTime +
                ", isRead=" + isRead +
                '}';
    }


}
